package com.lpf.abstractfactory;

// 客户端代码
public class Client {
    public static void main(String[] args) {
        AbstractFactory factory1 = new ConcreteFactory1();
        AbstractProductA productA1 = factory1.createProductA();
        AbstractProductB productB1 = factory1.createProductB();
        productA1.operationA(); // 输出: ConcreteProductA1 operation
        productB1.operationB(); // 输出: ConcreteProductB1 operation

        AbstractFactory factory2 = new ConcreteFactory2();
        AbstractProductA productA2 = factory2.createProductA();
        AbstractProductB productB2 = factory2.createProductB();
        productA2.operationA(); // 输出: ConcreteProductA2 operation
        productB2.operationB(); // 输出: ConcreteProductB2 operation
    }
}
